const cloud = require('wx-server-sdk');
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV });
const db = cloud.database();

exports.main = async (event, context) => {
  const { patientId } = event;
  try {
    await db.collection('patients').doc(patientId).remove();
    return { success: true };
  } catch (e) {
    return { success: false, message: '删除失败' };
  }
};